//
//  BKBaseTouchView.h
//  mutilyWebView
//
//  Created by 曹飞 on 2017/12/4.
//  Copyright © 2017年 tv.buka. All rights reserved.
//




#import <UIKit/UIKit.h>


#import "BKTempMoveView.h"

//双击触发全屏幕
//四个角触发放大缩小
//其他地方可触发移动
typedef NS_ENUM(NSInteger,GestureType) {
    GestureTypeNon,
    GestureTypeLeftUp,
    GestureTypeRightUp,
    GestureTypeLeftDown,
    GestureTypeRightDown,
    GestureTypeDoubleClick,
    GestureTypeMove
};

@class BKBaseTouchView;

typedef void(^BKBaseTouchMoveEnd)(id view, CGRect moveFrame, CGRect superViewFrame);
typedef void(^BKBaseTouchViewTap)(id view);
typedef void(^BKBaseTouchViewTap2)(id view, UIPanGestureRecognizer *pan);


@interface BKBaseTouchView : UIView


@property (nonatomic,copy) BKBaseTouchViewTap tapBlock;
@property (nonatomic,copy) BKBaseTouchViewTap2 doubleTapBlock;
@property (nonatomic,copy) BKBaseTouchMoveEnd moveEndBlock;


@property (nonatomic,strong) UIPanGestureRecognizer *pan;
@property (nonatomic,weak) BKTempMoveView * tempView;
@property (nonatomic,assign) GestureType startMoveType;

@property (nonatomic,assign) BOOL canMove; //默认是YES 可以拖动
@property (nonatomic,assign) BOOL canTap; //默认是YES  可点击
@property (nonatomic,assign) BOOL canUpLeftBottomRight; // 默认YES 表示开放四个角的放大缩小  设置NO， 则只有GestureTypeMove ，


@property (nonatomic,assign) CGPoint startedPoint;
@property (nonatomic,assign) CGRect demoViewStartedFrame;
@property (nonatomic,assign) CGFloat h;
@property (nonatomic,assign) CGFloat y;
@property (nonatomic,assign) CGFloat x;
@property (nonatomic,assign) CGPoint translation;

-(void)tapAction:(UITapGestureRecognizer *)gestureRecognizer;
-(GestureType)moveTypeWithGesture:(UIPanGestureRecognizer *)panGestureRecognizer;
@end
